package com.xingkeduo.business.user.service;

import com.xingkeduo.dao.database.DatabaseAccessObject;
import com.xingkeduo.pojo.query.ConsumerLoginHistoryQO;
import com.xingkeduo.pojo.table.ConsumerLoginHistoryTO;
import com.xingkeduo.util.tool.CommonUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 消费者登录历史表
 *
 * @Description:
 * @Author:gaozifeng
 * @Date 2019/2/27 18:05
 **/
@Service
public class ConsumerLoginHistoryService {
    private static final String NAMESPACE = CommonUtil.formatNamespace(ConsumerLoginHistoryTO.class);
    @Resource(name = "mysqlUserMasterDao")
    private DatabaseAccessObject<ConsumerLoginHistoryTO, ConsumerLoginHistoryQO> dao;


    /**
     * 查询登录历史
     *
     * @param userid:
     * @return : com.xingkeduo.pojo.table.ConsumerThirdTO
     * @author : gaozifeng
     * @date : 2019/2/27 21:30
     */
    public ConsumerLoginHistoryTO userDetail(long userid) throws Throwable {
        return dao.select(NAMESPACE, userid);
    }

    /**
     * 查询消费者登录历史集合
     *
     * @param consumerThirdQO:
     * @return : java.util.List<com.xingkeduo.pojo.table.ConsumerThirdTO>
     * @author : gaozifeng
     * @date : 2019/2/27 21:33
     */
    public List<Long> userListTotal(ConsumerLoginHistoryQO consumerThirdQO) throws Throwable {
        return dao.selectIndex(NAMESPACE, consumerThirdQO);
    }

    /**
     * 查询id集合
     *
     * @param consumerThirdQO:
     * @return : java.util.List<com.xingkeduo.pojo.table.ConsumerThirdTO>
     * @author : gaozifeng
     * @date : 2019/2/27 21:33
     */
    public List<ConsumerLoginHistoryTO> userList(ConsumerLoginHistoryQO consumerThirdQO) throws Throwable {
        return dao.select(NAMESPACE, consumerThirdQO);
    }


}
